cmake_minimum_required(VERSION 3.20)

project(compile)

set(CMAKE_CXX_STANDARD 23)

find_package(BISON)
find_package(FLEX)

BISON_TARGET(MyParser grammar/parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
FLEX_TARGET(MyScanner grammar/lexer.l  ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)

include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_executable(compile
        src/c0.cpp
        include/c0.h
#        driver.cpp
        ${BISON_MyParser_OUTPUTS}
        ${FLEX_MyScanner_OUTPUTS}
        )
target_link_libraries(compile ${FLEX_LIBRARIES})

